package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhSupplierGoodSpecMapper;
import com.ruoyi.xh.domain.XhSupplierGoodSpec;
import com.ruoyi.xh.service.IXhSupplierGoodSpecService;

/**
 * 商品规格Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhSupplierGoodSpecServiceImpl extends ServiceImpl<XhSupplierGoodSpecMapper,XhSupplierGoodSpec> implements IXhSupplierGoodSpecService {

    /**
     * 查询商品规格
     * 
     * @param id 商品规格主键
     * @return 商品规格
     */
    @Override
    public XhSupplierGoodSpec selectXhSupplierGoodSpecById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询商品规格列表
     * 
     * @param xhSupplierGoodSpec 商品规格
     * @return 商品规格
     */
    @Override
    public Page<XhSupplierGoodSpec> selectXhSupplierGoodSpecList(XhSupplierGoodSpec xhSupplierGoodSpec)
    {
        return new Page<>();
    }

    /**
     * 新增商品规格
     * 
     * @param xhSupplierGoodSpec 商品规格
     *
     */
    @Override
    public void insertXhSupplierGoodSpec(XhSupplierGoodSpec xhSupplierGoodSpec)
    {
        this.save(xhSupplierGoodSpec);
    }

    /**
     * 修改商品规格
     * 
     * @param xhSupplierGoodSpec 商品规格
     *
     */
    @Override
    public void updateXhSupplierGoodSpec(XhSupplierGoodSpec xhSupplierGoodSpec)
    {
        this.updateById(xhSupplierGoodSpec);
    }

    /**
     * 批量删除商品规格
     * 
     * @param ids 需要删除的商品规格主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhSupplierGoodSpecByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
